package edu.scau.ojforwarder.bean;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * hdu官方的judge status，包括Queuing，Compiling，Running，Accepted，Wrong Answer，Presentation Error，Compilation Error，
 * Time Limit Exceeded，Memory Limit Exceeded，Output Limit Exceeded，Runtime Error后面还会附带具体原因，如
 * Runtime Error(ACCESS_VIOLATION)，Runtime Error(INTEGER_DIVIDE_BY_ZERO)，Runtime Error(STACK_OVERFLOW)等
 */
public class HduStatus implements Cloneable {
    public static final String PENDING = "pending";             //等待提交
    public static final String SUBMIT_FAILED = "submit failed"; //提交失败

    private String submissionId;
    private String runId;
    private String submitTime;
    private int result;
    private String status = PENDING;    // 默认状态为等待提交
    private String proId;
    private String cid; //Contest Id
    private String exeTime;
    private String exeMemory;
    private String language;
    private String compileError;

    @JsonIgnore
    private HduError error;

    public HduStatus(String cid) {
        this.cid = cid;
    }

    public String getSubmissionId() {
        return submissionId;
    }

    public void setSubmissionId(String submissionId) {
        this.submissionId = submissionId;
    }

    public String getRunId() {
        return runId;
    }

    public void setRunId(String runId) {
        this.runId = runId;
    }

    public String getSubmitTime() {
        return submitTime;
    }

    public void setSubmitTime(String submitTime) {
        this.submitTime = submitTime;
    }

    public int getResult() {
        return result;
    }

    public void setResult(int result) {
        this.result = result;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getProId() {
        return proId;
    }

    public void setProId(String proId) {
        this.proId = proId;
    }

    public String getCid() {
        return cid;
    }

    public String getExeTime() {
        return exeTime;
    }

    public void setExeTime(String exeTime) {
        this.exeTime = exeTime;
    }

    public String getExeMemory() {
        return exeMemory;
    }

    public void setExeMemory(String exeMemory) {
        this.exeMemory = exeMemory;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public HduError getError() {
        return error;
    }

    public void setError(HduError error) {
        this.error = error;
    }

    public String getCompileError() {
        return compileError;
    }

    public void setCompileError(String compileError) {
        this.compileError = compileError;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
